package com.area.controller;


import com.area.entity.Brand;
import com.area.service.IBrandService;
import com.code.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author guanfenga@yonyou.com
 * @since 2023-01-10
 */
@Controller
@ApiOperation(value = "商品分类", notes = "商品分类")
@RequestMapping("/brand")
@Slf4j
@CrossOrigin
public class BrandController {

    @Autowired
    private IBrandService brandService;

    @ApiOperation(value = "查询所有品牌", notes = "查询所有品牌")
    @GetMapping("/queryBrandAll")
    public @ResponseBody AjaxResult queryBrandAll(Brand brand,
                                                  HttpServletResponse request,
                                                  HttpServletResponse response) {
        List<Brand> brandList = brandService.queryBrandAll(brand);
        return new AjaxResult(0, "操作成功", brandList);
    }


}
